<!DOCTYPE html>
<html lang="en">
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
	<meta name="Keywords" content="">
	<meta name="description" content="">
	<link rel="shortcut icon" type="image/x-icon" href="/static/images/favicon.ico">
	<!--公共部分-->
	<link href="/static/www/css/layout.css" type="text/css" rel="stylesheet" />
	<script src="/static/public/jquery-1.11.1.min.js" type="text/javascript"></script>
	<!--私有部分-->
	<link href="/static/www/css/default.style.css" type="text/css" rel="stylesheet" />

	<title>注册-学员中心</title>

	<script>
	$(function () {
		$("#btn_submit").click(function () {
			$("form").submit();
		})
	})
	</script>

	<style>
html{ height:100%; min-width:800px;}
</style>
</head>

<body class="wx_body" style="background:url(/static/www/images/loginbg.jpg) no-repeat center top #1DA5FB">
<div class="dl_wrap">
	<div class="wangxiao_box" style="position: inherit; float: left; margin-left: 67%; margin-top: 3px;">
        <div class="mt"><span class="fs20">学员注册</span><a href="/login">登录</a></div>
        <div class="mc" id="register">
            <div class="formPopu">
            <form action="/reg" method="post">
                <ul>
                    <li class="iFrTit"><span name="fr_tit">手机号：</span>
                    <input name="phone" id="phone" maxlength="11" value="<{if isset($phone)}><{$phone}><{/if}>" type="text" class="text" placeholder="请输入您的手机号">
                    <{if isset($phone_err)}>
                    	<label name="fr_tip" class="r"><{$phone_err}></label>
					<{/if}>
                    </li>
                    <li class="iFrTit">
                    <span name="fr_tit">验证码：</span>
                    <input maxlength="4" name="vcode" type="text" class="text" placeholder="请输入短信验证码">
                    <a href="javascript:;" class="r code_btn send-msg" hasclick="1" >获取验证码</a>
                    
                    </li>
                    <li class="iFrTit"><span name="fr_tit">设置密码：</span>
                    <input  type="password" maxlength="11" name="password" type="password" class="text" placeholder="6-20个大小写英文字母或数字">
                    <!-- <label name="fr_tip" class="r">输入成功</label> -->
                    </li>
                    <li class="iFrTit"><span name="fr_tit">确认密码：</span>
                    <input  type="password" maxlength="11" name="con_password" type="password" class="text" placeholder="6-20个大小写英文字母或数字">
                    <!-- <label name="fr_tip" class="r">输入成功</label> -->
                    </li>
                </ul>
               <!--  <div class="p-lr10"><label class="c-666666"><input type="checkbox">&nbsp;&nbsp;同意</label><a class="c-1aa3fa" href="#">《德安信用户协议》</a></div> -->
                <div class="p-t40"><a href="javascript:;" id="btn_submit" class="b-1aa3fa btn u2 fs20">注册</a></div>
            </form>
            </div>
        </div>
    </div>
</div>
<script type="text/javascript">
	$(function ($) {
		<{if !empty($msg)}>
		alert("<{$msg}>");
		<{/if}>
		var countdown = 5;
		//发送短信验证码
		$(".send-msg").click(function(){
			var obj = $(this);
			var linkPhone = $("#phone").val();
			if(linkPhone==""){
				alert("请填写手机号");
				$("#phone").focus();
				return;
			}else{
				var hasClick = $(obj).attr("hasclick");
				if (hasClick == 1) {
//                    alert("开始获取验证码");
					countdown = 60;
					$.ajax({
						url:"/reg/reg_msg/"+linkPhone,
						type:"post",
						dataType:"json",
						success:function(res){
							if(res.code==201){
								$("#pwd_li").remove();
								settime(obj);
							} else if (res.code == 200) {
								alert("短信发送成功！请注意查收！");
								settime(obj);
							}else{
								alert(res.msg);
							}
						}
					});
				}
			}

		});


		function settime(val) {
			if (countdown == 0) {
				//                $(val).removeAttribute("disabled");
				$(val).attr("hasclick", "1");
				$(val).text("重新发送");
			} else {
				$(val).attr("hasclick", "0");
				//                $(val).("disabled", true);
				$(val).text("重新发送(" + countdown + ")");
				countdown--;
				setTimeout(function () {
					settime(val)
				}, 1000);
			}
		}

	});
</script>
</body>
</html>